#!/usr/bin/env node


const Koa = require('koa');

const app = new Koa(),
      log = console.log;

app.use((ctx , next) =>{
  if(ctx.method === 'GET' && ctx.path ==='/api/tasks/'){
    log('待办事项列表');
    ctx.body = '查询成功');
  }
 if(ctx.method === 'POST' && ctx.path ==='/api/tasks/'){
    log('待办事项列表');
    ctx.body = '查询成功');
  }
  if(ctx.method === 'PUT' && ctx.path ==='/api/tasks/'){
    log('待办事项列表');
    ctx.body = '查询成功');
  }
  if(ctx.method === 'DELETE' && ctx.path ==='/api/tasks/'){
    log('待办事项列表');
    ctx.body = '查询成功');
  }

});

app.listen(8080);

